<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>09论坛主页</title>
    <!-- Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        function syso(name) {
            document.write(name);
        }
    </script>
</head>

<body style="background-color: #f0f2f5">
    <div class="row clearfix" style="background-color:#393d49">
        <div class="col-md-12 column">
            <ul class="nav nav-pills">
                <li class="active" style="margin-left: 5%">
                    <a href="index2">首页</a>
                </li>
                <li>
                    <a href="#">板块</a>
                </li>
                <li>
                    <a href="#">帮助</a>
                </li>
                <li style="margin-left: 70%">
                    <a href="#" data-toggle="dropdown" class="dropdown-toggle"><span
                            class="glyphicon glyphicon-user">&nbsp;</span>欢迎你！${sessionScope.session_user.getName()}<strong
                            class="caret"></strong></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="center">个人中心</a>
                        </li>
                        <li>
                            <a href="logout">退出登录</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="container">
        <div class="page-header">
            <h1>
                <small style="font-style: italic">快捷导航</small>
            </h1>
        </div>
        <ul class="breadcrumb" style="background-color: #f0f2f5">
            <li>
                <a href="life">生活</a>
            </li>
            <li>
                <a href="entertainment">娱乐</a>
            </li>
            <li>
                <a href="school">校园</a>
            </li>
        </ul>
        <div class="page-header">
            <h1 style="font-style: italic">
                近期帖子
            </h1>
        </div>
        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th>
                        帖子ID
                    </th>
                    <th>
                        帖子标题
                    </th>
                    <th>
                        内容前瞻
                    </th>
                    <th>
                        发帖人
                    </th>
                </tr>
            </thead>
            <tbody>
                <c:forEach items="${aList}" var="bean">
                    <tr class="success">
                        <td>
                            ${bean.aid}
                        </td>
                        <td>
                            <a href="look?id=${bean.aid}">
                                ${bean.title}
                            </a>
                        </td>
                        <td>
                            <c:choose>
                                <c:when test="${fn:length(bean.text) > 10}">
                                    <c:out value="${fn:substring(bean.text, 0, 10)}......" />
                                </c:when>
                                <c:otherwise>
                                    <c:out value="${bean.text}" />
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td>
                            ${bean.name}
                        </td>
                    </tr>
                </c:forEach>

            </tbody>
        </table>
        <a href="wantPost">
            <button type="button" class="btn btn-lg btn-info btn-block"><span
                    class="glyphicon glyphicon-pencil">&nbsp;</span>我想水贴</button>
        </a>
    </div>
</body>

</html>